/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edmo.fastener;

import com.edmo.fastener.business.CheckFiles;
import com.edmo.fastener.business.CryptoKeyGenerator;
import com.edmo.fastener.jms.StartListener;
import com.edmo.fastener.parser.ParseCustomer;
import com.edmo.fastener.parser.ParseSuppliers;
import java.net.URISyntaxException;
import java.util.logging.Logger;

/**
 *
 * @author Alexx
 */
public class Start {
    private static Logger log = Logger.getLogger(Start.class.getName());
    
    public static void main (String[] args) throws URISyntaxException{
        if (args[0].equals("s")){
           startServer(); 
        } else if (args[0].equals("n")){
            StartListener.go();
            log.info("Node started");
        }
    }
    
    public static void startServer() throws URISyntaxException{
        //Get list of Customers
        new ParseCustomer().readnParse();
        //Get list of Suppliers
        new ParseSuppliers().readnParse(); 
        
        Thread checker = new Thread(new CheckFiles());
        checker.start();
    }
}
